<template>
  <footer class="footer-container flex flex-between">
    <div class="rights">
      <!-- <p>©2018 - 2021 Yabu Pushelberg All rights reserved</p> -->
      <p>©2018 - 2021 xc.com All rights reserved</p>
    </div>
    <div class="gotop" @click="goPost">
      <span class="f18">GoTop</span>
    </div>
    
  </footer>
</template>

<script>
import { ref, watch } from "vue";
import { useRoute, useRouter } from "vue-router";

export default {
  name:'FFooter',
  setup(params, ctx) {
    const goPost = () => {
      const doc = document.documentElement || document.body
      let distance = doc.scrollTop; //获得当前高度
      (function jump() {
        let step = distance / 5; //每步的距离
        if (distance > 0) {
            distance -= step;
            distance = distance < 1 ? 0 : distance
            window.scrollTo(0, distance);
            window.requestAnimationFrame(jump)
        }
      })();
    }
    return {
      goPost
    };
  },
};
</script>
<style lang="less" scoped>

.footer-container{
  transition: padding .4s ease;
  will-change: padding;
  .padding-top(30px);
  .padding-bottom(30px);
  .padding-left(36px);
  .padding-right(36px);
  @media @max768{
    .padding-top(20px);
    .padding-bottom(20px);
    .padding-left(26px);
    .padding-right(26px);
  }
}
.gotop{
  cursor: pointer;
}
</style>